package com.winskysoft.frame;

import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.SWT;
import org.eclipse.wb.swt.SWTResourceManager;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;

public class SelectSqlPanel extends Composite implements SelectionListener{
	private Text text;

	/**
	 * Create the composite.
	 * @param parent
	 * @param style
	 */
	public SelectSqlPanel(Composite parent, int style) {
		super(parent, style);
		
		Combo combo = new Combo(this, SWT.NONE|SWT.READ_ONLY);
		combo.setLocation(50, 41);
		combo.setSize(494, 24);
		combo.setEnabled(false);
		combo.setFont(SWTResourceManager.getFont("宋体", 12, SWT.NORMAL));
		combo.setItems(new String[] {"mysql", "sql server", "oracle"});
		combo.select(0);
		
		Button btnNewButton = new Button(this, SWT.NONE);
		btnNewButton.addSelectionListener(this);
		btnNewButton.setLocation(437, 284);
		btnNewButton.setSize(79, 34);
		btnNewButton.setText("\u4E0B\u4E00\u6B65");

	}

	@Override
	protected void checkSubclass() {
		// Disable the check that prevents subclassing of SWT components
	}
	
	@Override
	public void widgetSelected(SelectionEvent e) {
		
		SqlInfoPanel sqlInfoPanel=new SqlInfoPanel(getParent(), SWT.NONE);
		sqlInfoPanel.setSize(getSize());
		this.dispose();
	}

	@Override
	public void widgetDefaultSelected(SelectionEvent e) {
		// TODO Auto-generated method stub
		
	}
}
